﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ControlDetailPhanChiaDS.ascx.cs" Inherits="UserControl_ControlDetailPhanChiaDS" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPopupControl" tagprefix="dxpc" %>



<script type="text/javascript">



    function pageLoad() {



        $(".direct_margin_topbottom").click(function () {

            $.blockUI({
                message: '<h1>Xin vui lòng chờ xử lý</h1>',
                css: {
                    border: 'none',
                    padding: '15px',
                    backgroundColor: '#f00',
                    opacity: .5,
                    color: '#fff'
                }
            });

        });
        $("#<%= imgBtnSave.ClientID %>").click(function () {
            $.blockUI({ css: {
                border: 'none',
                padding: '15px',
                backgroundColor: '#000',
                '-webkit-border-radius': '10px',
                '-moz-border-radius': '10px',
                opacity: .5,
                color: '#fff'
            }
            });
    });
   
    $("#<%= imgBtnBack.ClientID %>").click(function () {
        $.blockUI({ css: {
            border: 'none',
            padding: '15px',
            backgroundColor: '#000',
            '-webkit-border-radius': '10px',
            '-moz-border-radius': '10px',
            opacity: .5,
            color: '#fff'
        }
        });
    });
    
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
        function EndRequestHandler(sender, args) {
            $.unblockUI();
        }

    }

</script>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
  
        <div class="direct_container_right_titletop">
            Chi tiết phân chia doanh số cho TDV
        </div>
        <hr />
        <!-- Button chuc nang-->
        <div class="direct_container_main">
            <asp:ImageButton ID="imgBtnSave" ToolTip="Lưu thông tin đã phân chia cho TDV" onclick="imgBtnSave_Click" ImageUrl="~/Images/save.png" Width="32px" Height="32px" runat="server" />
            <asp:ImageButton ID="imgBtnBack" ToolTip="Quay lại màn hình chọn TDV" onclick="imgBtnBack_Click"  ImageUrl="~/Images/Arrow-Right.png" Width="32px" Height="32px" runat="server" />
             
        </div>   
        <cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" 
            BackColor="#CCFFFF" Font-Names="Arial" 
            Width="100%">
             <cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="Thông tin phân chia" TabIndex="0">
                 <ContentTemplate>
        <div class="direct_container_form_right">
         <table border="0" width="100%">
                        
                        <tr>
                        <td>
                            <asp:RadioButtonList ID="RadioSelect" RepeatDirection="Horizontal" runat="server">
                                <asp:ListItem Text="Chia đều cho tất cả" Value="0" Selected="True"></asp:ListItem>
                                <asp:ListItem Text="Chia theo tùy chọn" Value="1"></asp:ListItem>
                                <asp:ListItem Text="Chia cho chính TDV" Value="2"></asp:ListItem>
                            </asp:RadioButtonList>
                        </td>
                        </tr>
                          
                        <tr>
                            <td>
                               Doanh số của TDV : 
                                <asp:Label ID="lblTDV" runat="server" Text=""></asp:Label>
                               được phân chia như sau :
                            </td>
                        </tr>
                        <tr>
                        <td>
                            <asp:GridView ID="grvTDV" runat="server" AutoGenerateColumns="False" 
                                        onrowcommand="grvTDV_RowCommand" 
                                        
                                         DataKeyNames="ToSalesKey" EnableModelValidation="True">
                                         <Columns>
                            <asp:TemplateField HeaderText="Stt">
                                <HeaderTemplate>
                                                                    STT
                                                                
                                         
                                </HeaderTemplate>
                            <ItemTemplate>
                                                                    <%# Container.DataItemIndex + 1 %>
                                                                
</ItemTemplate>

<HeaderStyle HorizontalAlign="Left" Width="50px" />

<ItemStyle Height="40px" HorizontalAlign="Left" Width="50px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Mã TDV"><HeaderTemplate>
                                                                   Mã TDV
                                                                
</HeaderTemplate>
<ItemTemplate>
                                                                  
                  <asp:Label ID="lblsalesp_key" runat="server" Text='<%# Eval("ToSalesKey")%>'></asp:Label>                                               
</ItemTemplate>

<HeaderStyle HorizontalAlign="Left" Width="100px" />

<ItemStyle Height="40px" HorizontalAlign="Left" Width="100px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="Họ tên"><HeaderTemplate>
                                                                   Họ tên
                                                                
</HeaderTemplate>
<ItemTemplate>
                                                                   
                    <asp:Label ID="lblsalesp_name" runat="server" Text='<%# Eval("salesp_name")%>'></asp:Label>                                             
</ItemTemplate>

<HeaderStyle HorizontalAlign="Left" Width="250px" />

<ItemStyle Height="40px" HorizontalAlign="Left" Width="250px" />
</asp:TemplateField>

<asp:TemplateField HeaderText="Chỉ số (%)"><HeaderTemplate>
                                                                   Chỉ số (%)
                                                                
</HeaderTemplate>
<ItemTemplate>

    <asp:TextBox ID="txtRate" runat="server" Text='<%# Eval("Rate")%>'></asp:TextBox>                                                 
           <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" 
                                                        runat="server" Enabled="True" FilterType="Numbers" 
                                                        TargetControlID="txtRate">
                                                 </cc1:FilteredTextBoxExtender>                                                    
</ItemTemplate>

<HeaderStyle HorizontalAlign="Left" Width="100px" />

<ItemStyle Height="40px" HorizontalAlign="Left" Width="100px" />
</asp:TemplateField>





<asp:TemplateField HeaderText="Xóa">

                                                                 <ItemTemplate>
                                                                    <asp:ImageButton ID="imgBtnChon" runat="server" CausesValidation="False" 
                                                                    CommandName="chon" Height="20px" ImageUrl="~/Images/delete.png" />
                                                                </ItemTemplate>
                                                                <ControlStyle BackColor="White" BorderColor="White" />
                                                                <FooterStyle BackColor="White" BorderColor="White" />
                                                               <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                                                <ItemStyle BackColor="White" HorizontalAlign="Center" BorderColor="White" />
                                                            </asp:TemplateField>
</Columns>
</asp:GridView>
                        </td>
                        </tr>
        </table>
        </div>
         </ContentTemplate>
        </cc1:TabPanel>
              <cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="Chọn TDV" TabIndex="1">
                 <ContentTemplate>
                     <div class="direct_container_form_right">
         <table border="0" width="100%">
                         
                      
                        <tr>
                        <td colspan="2">
                             <asp:GridView ID="grvSelectTDV" runat="server" AutoGenerateColumns="False" 
                                         OnRowCommand="grvSelectTDV_RowCommand"
                                         DataKeyNames="salesp_key" EnableModelValidation="True">
                                         <Columns>
                           
                            <asp:TemplateField HeaderText="Stt">
                                <HeaderTemplate>
                                                                    STT
                                                                
                                         
                                </HeaderTemplate>
                            <ItemTemplate>
                                                                    <%# Container.DataItemIndex + 1 %>
                                                                
</ItemTemplate>

<HeaderStyle HorizontalAlign="Left" Width="50px" />

<ItemStyle Height="40px" HorizontalAlign="Left" Width="50px" />
</asp:TemplateField>
                            <asp:TemplateField HeaderText="Mã TDV"><HeaderTemplate>
                                                                    Mã TDV
                                                                
</HeaderTemplate>
<ItemTemplate>
                                                                  
                  <asp:Label ID="lblsalesp_key" runat="server" Text='<%# Eval("salesp_key")%>'></asp:Label>                                               
</ItemTemplate>

<HeaderStyle HorizontalAlign="Left" Width="150px" />

<ItemStyle Height="40px" HorizontalAlign="Left" Width="150px" />
</asp:TemplateField>
                            <asp:TemplateField HeaderText="Họ tên">
                            <HeaderTemplate>
                                                                    Họ tên
                                                                
</HeaderTemplate>
<ItemTemplate>
                                                                   
                    <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("salesp_name")%>'></asp:Label>                                             
</ItemTemplate>

<HeaderStyle HorizontalAlign="Left" Width="200px" />

<ItemStyle Height="40px" HorizontalAlign="Left" Width="200px" />
</asp:TemplateField>  
                            <asp:TemplateField>
                                            <ItemTemplate>
                                            <asp:ImageButton ID="imgBtnChon" runat="server" CausesValidation="False" CommandName="chon"
                                                            Height="25px" Width="25px" ImageUrl="~/Images/check.png" />
                                                </ItemTemplate>
                                                            <ControlStyle BackColor="White" BorderColor="White" />
                                                            <FooterStyle BackColor="White" BorderColor="White" />
                                                            <HeaderStyle BackColor="White" BorderColor="White" />
                                                            <ItemStyle BackColor="White" BorderColor="White" />
                                           </asp:TemplateField>


</Columns>
</asp:GridView>
                         </td>
                        </tr>
           </table>
       
        </div>
                 </ContentTemplate>
        </cc1:TabPanel>
         </cc1:TabContainer>
        <dxpc:ASPxPopupControl ID="MessageBox" PopupHorizontalAlign="WindowCenter"  PopupVerticalAlign="WindowCenter" Font-Bold="true" HeaderText="DRM-S" runat="server" Height="91px" 
        Width="601px">
        <ContentCollection>
<dxpc:PopupControlContentControl ID="PopupControlContentControl1" runat="server" SupportsDisabledAttribute="True"></dxpc:PopupControlContentControl>
</ContentCollection>
    </dxpc:ASPxPopupControl>
      </ContentTemplate>
 </asp:UpdatePanel>